﻿
on_birth_child = {
    on_actions = { mcfm_on_brith_child }
}

mcfm_on_brith_child = {
    trigger = {
        scope:child = {
            has_trait = futa_genetic
            NOT = { has_trait = futa_exposed }
        }
    }

    effect = {
        if = {
            if = {
                limit = {
                    scope:mother = {
                        OR = {
                            faith = { has_doctrine = futa_doctrine_futanari_equality_crime }
                            faith = { has_doctrine = futa_doctrine_futanari_equality_shunned }
                        }
                    }
                    scope:father ?= {
                        OR = {
                            faith = { has_doctrine = futa_doctrine_futanari_equality_crime }
                            faith = { has_doctrine = futa_doctrine_futanari_equality_shunned }
                        }
                    }
                }
                scope:child = {
                    add_secret = {
                        type = secret_futa
                        save_scope_as = new_secret
                    }
                }
                scope:new_secret = { reveal_to = scope:mother }
                scope:new_secret ?= { reveal_to = scope:father }
                scope:mother = {
                    trigger_event = {
                        id = mcfm_birth.0001
                        days = 3
                    }
                }
                scope:father ?= {
                    trigger_event = {
                        id = mcfm_birth.0001
                        days = 3
                    }
                }
            } #Accepting
            else_if = {
                limit = {
                    scope:mother = { faith = { has_doctrine = futa_doctrine_futanari_equality_accepted } }
                    scope:father ?= { faith = { has_doctrine = futa_doctrine_futanari_equality_accepted } }
                }
                scope:child = { add_trait = futa_exposed }
            }
            else_if = {
                limit = {
                    scope:mother = {
                        OR = {
                            faith = { has_doctrine = futa_doctrine_futanari_equality_virtuous }
                            faith = { has_doctrine = futa_doctrine_futanari_equality_venerated }
                        }
                    }
                    scope:father ?= {
                        OR = {
                            faith = { has_doctrine = futa_doctrine_futanari_equality_virtuous }
                            faith = { has_doctrine = futa_doctrine_futanari_equality_venerated }
                        }
                    }
                }
                scope:child = { add_trait = futa_exposed }
                scope:mother = {
                    trigger_event = {
                        id = mcfm_birth.0002
                        days = 3
                    }
                }
                scope:father ?= {
                    trigger_event = {
                        id = mcfm_birth.0002
                        days = 3
                    }
                }
            }
        }
    }
}

